package com.pdsu.xpf.graduation01.dao;

import com.pdsu.xpf.graduation01.dto.PayCommodityDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IPayCommodityDao {


    @Select("SELECT co.username,co.cid,co.uid,co.cname,co.cmessage,co.cnumber,ut.ucnumber,co.image,co.price,co.sell_desc  FROM commodity as co ,user_trolley as ut where ut.uid = #{uid} and ut.cid = co.cid ")
    List<PayCommodityDTO> findPayCommodityByUID(int uid);


    @Delete("delete from user_trolley where uid = #{uid} and cid = #{cid}")
    Integer removePayCommodityByUIDAndCID(int uid, int cid);
}
